﻿using System.IO;

namespace TrrntzipDN.IO
{

    public class FileInfo
    {

        public string FullName
        {
            get { return fi.FullName; }
        }

        public long LastWriteTime { get { return fi.LastWriteTime.Ticks; } }

        private readonly System.IO.FileInfo fi;
       
        public FileInfo(string path)
        {
            fi=new System.IO.FileInfo(path);
        }

    }


    public static class File
    {
        public static bool Exists(string path)
        {
            return System.IO.File.Exists(path);
        }

        public static void Delete(string path)
        {
            System.IO.File.Delete(path);
        }
    }

    public static class Directory
    {
        public static bool Exists(string path)
        {
            return System.IO.Directory.Exists(path);
        }

        public static DirectoryInfo CreateDirectory(string path)
        {
            return System.IO.Directory.CreateDirectory(path);
        }
    }

    public static class Path
    {
        public static char DirectorySeparatorChar { get { return System.IO.Path.DirectorySeparatorChar; }}

        public static string GetDirectoryName(string path)
        {
            return System.IO.Path.GetDirectoryName(path);
        }


    }

    public static class FileStream
    {
        public static int OpenFileRead(string path, out Stream stream)
        {
            stream = new System.IO.FileStream(path, FileMode.Open, FileAccess.Read);
            return 0;
        }

        public static int OpenFileWrite(string path, out Stream stream)
        {
            stream = new System.IO.FileStream(path,FileMode.Create,FileAccess.Write);
            return 0;
        }

    }

}
